/**
 * 
 */
package org.dragonfire.editor.syntax.rules.tibasic;

import java.util.ArrayList;

import org.dragonfire.editor.syntax.rules.KeywordRule;
import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;

/**
 * @author Darth Android
 * @date Dec 28, 2007
 */
public class TIBasicFunctionRule extends KeywordRule {

	/**
	 * @param functions
	 */
	public TIBasicFunctionRule(ArrayList<String> functions) {
		super(functions);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param functions
	 * @param attributeName
	 */
	public TIBasicFunctionRule(ArrayList<String> functions, String attributeName) {
		super(functions, attributeName);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param functions
	 */
	public TIBasicFunctionRule(String[] functions) {
		super(functions);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param functions
	 * @param attributeName
	 */
	public TIBasicFunctionRule(String[] functions, String attributeName) {
		super(functions, attributeName);
		// TODO Auto-generated constructor stub
	}

	public IToken evaluate(ICharacterScanner scanner) {
		IToken tok = super.evaluate(scanner);
		if (tok != Token.UNDEFINED) {
			int next = scanner.read();
			scanner.unread();
			if (next == '(')
				return tok;
		}
		return Token.UNDEFINED;
	}
}
